// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RobotiqSModelState.cs" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace Microsoft.Robotics.Hardware.Robotiq
{
    using System.Runtime.Serialization;

    /// <summary>
    /// State for a Robotiq S Model gripper
    /// </summary>
    [DataContract]
    public class RobotiqSModelState
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="RobotiqSModelState"/> class.
        /// </summary>
        public RobotiqSModelState()
        {
            this.FingerAState = new RobotiqSModelFingerState();
            this.FingerBState = new RobotiqSModelFingerState();
            this.FingerCState = new RobotiqSModelFingerState();
            this.ScissorState = new RobotiqSModelFingerState();
        }

        /// <summary>
        /// Gets a value indicating whether the gripper has been activated.
        /// </summary>
        [DataMember]
        public bool IsActivated { get; internal set; }

        /// <summary>
        /// Gets the gripper mode
        /// </summary>
        [DataMember]
        public RobotiqSModelGripModes GripMode { get; internal set; }

        /// <summary>
        /// Gets a value indicating whether the 'go to position' bit is set.
        /// If the go to position bit is set the gripper will try to move to requested position.
        /// </summary>
        [DataMember]
        public bool GoToPosition { get; internal set; }

        /// <summary>
        /// Gets the status of the grip motion
        /// </summary>
        [DataMember]
        public RobotiqSModelGripStatus GripStatus { get; internal set; }

        /// <summary>
        /// Gets device status regarding reset, activation, and mode change.
        /// </summary>
        [DataMember]
        public RobotiqSModelStatus DeviceStatus { get; internal set; }

        /// <summary>
        /// Gets the state of Finger A (thumb).
        /// </summary>
        [DataMember]
        public RobotiqSModelFingerState FingerAState { get; internal set; }

        /// <summary>
        /// Gets the state of Finger B (right hand finger from view point of thumb).
        /// </summary>
        [DataMember]
        public RobotiqSModelFingerState FingerBState { get; internal set; }

        /// <summary>
        /// Gets the state of Finger C (left hand finger from view point of thumb).
        /// </summary>
        [DataMember]
        public RobotiqSModelFingerState FingerCState { get; internal set; }

        /// <summary>
        /// Gets the state of scissor axis.
        /// </summary>
        [DataMember]
        public RobotiqSModelFingerState ScissorState { get; internal set; }

        /// <summary>
        /// Gets the current gripper fault.
        /// </summary>
        [DataMember]
        public RobotiqSModelFaults Fault { get; internal set; }
    }
}
